////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return screenlication exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main rendering window
    sf::RenderWindow screen(sf::VideoMode(800, 600, 32), "JerricaLand", sf::Style::Fullscreen); 

    //Create the shape to act as a sprite till the game mechanics are figured out
    sf::Shape rect = sf::Shape::Rectangle(0, 0, 64, 64, sf::Color::Red);

    // Start game loop
    while (screen.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (screen.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed || Event.Key.Code == sf::Key::Escape)
                screen.Close();
        }

        // Get elapsed time
        float ElapsedTime = screen.GetFrameTime();

        // Move the sprite
        if (screen.GetInput().IsKeyDown(sf::Key::A))  	
	  rect.Move(-100 * ElapsedTime, 0);
        if (screen.GetInput().IsKeyDown(sf::Key::D)) 	
	  rect.Move( 100 * ElapsedTime, 0);
        if (screen.GetInput().IsKeyDown(sf::Key::W))    
	  rect.Move(0, -100 * ElapsedTime);
        if (screen.GetInput().IsKeyDown(sf::Key::S))  	
	  rect.Move(0,  100 * ElapsedTime);

        // Clear screen
        screen.Clear();

        // Display sprite in our window
        screen.Draw(rect);

        // Display window contents on screen
        screen.Display();
    }

    return EXIT_SUCCESS;
}
